From: Ian Campbell Date: Thu, 12 Mar 2015 17:56:47 +0000 (+0000) Subject: tools: xl: prepend root= to root field on command line with no extra X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3625^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=cde92647ea4f5c487059a3c89f2e3f1aec9a42d3;p=xen.git tools: xl: prepend root= to root field on command line with no extra This was broken in 49ab17a3a615 "tools: xl: handle unspecified extra= when dealing with root=". Reported-by: Sander Eikelenboom Signed-off-by: Ian Campbell Tested-by: Sander Eikelenboom Acked-by: Wei Liu --- diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index a27ac9e91a..04faf98426 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -817,7 +817,8 @@ static char *parse_cmdline(XLU_Config *config) if (asprintf(&cmdline, "root=%s %s", root, extra) == -1) cmdline = NULL; } else if (root) { - cmdline = strdup(root); + if (asprintf(&cmdline, "root=%s", root) == -1) + cmdline = NULL; } else if (extra) { cmdline = strdup(extra); }